
progname='shaxian'
prognamename = '数目检测'
saoma_port = 51236
saoma_ip = '192.168.1.150'
camnames = '12345'.split()
thd_conf = {
    # 'thd1': [100, 0, 600, '纱线数量'],
    #'plc_obj_sleep1': [100, 0, 10000, '延迟结束拍照毫秒'],
    #'julimax': [60, 0, 100, '最大距离'],
}
chk_conf = {
    'stopline': [0, '开启检测'],
    # 'use_thread': [1, '使用线程'],
}

camnames_ips = [
    '1.相机1 0 169.254.217.4 p'
]

def jiaodu_trans(x):
    x = x.replace('逆', '-').replace('顺', '+')
    x = int(x)
    return x

camnames_ips = [s.split() for s in camnames_ips]
camnames = [s[0] for s in camnames_ips]
id2index = {}
for index, x in enumerate(camnames):
    id = x.split('.')[0]
    id2index[id] = index
cam_rot = [jiaodu_trans(s[1]) for s in camnames_ips]
cam_ips = [s[2].split('.')[-1] for s in camnames_ips]
quexians = [s[3].split('+') for s in camnames_ips]

config = {
    "captype": "hk",
    "password": "",
    'ips': cam_ips,
    'camnames': camnames,
    "usbcamid": 1,
    "stopline_time": 15,
    "ncams": len(cam_ips),
    "saveimg": 1,
    "onlycapimg": 0,
    "use_pic_test": 1,
    'conf_thres': 0.4,
    'iou_thres': 0.1,
    'crop_num': 3,
    'imgsz': 512,
    'qutu_num': 8,
    'classname': '结构检验',
    'out_img_p': 'D:/data/save',
    'knum': '28'
}

# if 0:
#     import os
#     if os.path.exists('D:/code/git/ywlydd/cstd') or 0:
#         import myMVSCam as MVSCam
#         flip1_flag = 0
#     else:
#         import MVSCam
#         flip1_flag = 1
#
#     cam_ips1 = []
#     for index, ip in enumerate(cam_ips):
#         if str(ip) in MVSCam.num_device.keys():
#             cam_ips1.append(ip)
#
#     cam_ips = cam_ips1
#     config['ncams'] = len(cam_ips)